package com.liu.consumer;

import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class ConsumerOne {

    /**
     * 监听队列hello
     * @param message 收到的消息
     */
    @RabbitListener(queues = {"hello"})
    public void handler(Message message) {
        System.out.println("消费者收到消息：" + new String(message.getBody()));
    }
}
